<template>
	<u-popup v-model="mymine" mode="center" @close='close'>
		<view class="mymine">
			<view class="title">我的邀请人</view>
			<view class="img">
				<u-avatar :src="$util.img(info.avatar)"  :size='100'></u-avatar>
			</view>
			<view class="item">
				<view class="txt">qq号</view>
				<view class="info">|</view>
				<view class="input">
					<input type="text" placeholder="暂未设置" v-model="info.qq_no">
				</view>
				<view class="copy">
					<image :src="$util.img('/static/img/my/复制.png')" mode="widthFix" @click="copy(info.qq_no.toString())"></image>
				</view>
			</view>
			<view class="item">
				<view class="txt">微信号</view>
				<view class="info">|</view>
				<view class="input">
					<input type="text" placeholder="暂未设置" v-model="info.wechat_no">
				</view>
				<view class="copy">
					<image :src="$util.img('/static/img/my/复制.png')" mode="widthFix" @click="copy(info.wechat_no.toString())"></image>
				</view>
			</view>
			<view class="item">
				<view class="txt">手机号</view>
				<view class="info">|</view>
				<view class="input">
					<input type="text" placeholder="暂未设置" v-model="info.mobile">
				</view>
				<view class="copy">
					<image :src="$util.img('/static/img/my/复制.png')" mode="widthFix" @click="copy(info.mobile.toString())"></image>
				</view>
			</view>
		</view>
	</u-popup>
</template>

<script>
	export default {
		props: {
			mymineShow: {
				type: [String, Boolean],
				default: false
			},
		},
		data(){
			return {
				//控制弹窗
				mymine:true,
				//当前页面的数据
				info:{
					avatar:'',
					qq_no:'',
					wechat_no:'',
					mobile:'',
				}
			}
		},
		mounted() {
			this.getinfo();
		},
		watch: {
			mymineShow: {
				handler(newval, oldVal) {
					this.mymine = this.mymineShow;
				},
				immediate: true
			}
		},
		methods:{
			//弹窗关闭
			close(){
				this.$emit('close')
			},
			//獲取邀請人數據
			getinfo(){
				this.$http.asyncSendrequest({
					url:'/profile/myInvite',
					success:res=>{
						if(res.code == '0' && res.data){
							this.info = res.data;
						}
						
					}
				})
			},
			// 复制数据
			copy(value){
				this.$util.copy(value,(res)=>{
					console.log("zhegn1")
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.mymine{
		width: 80vw;
		min-height: 30vh;
		background: #fff;
		border-radius: 10rpx;
		padding: 30rpx 30rpx 40rpx;
		.title{
			font-size: 30rpx;
			font-weight: bold;
			text-align: center;
		}
		.img{
			display: flex;
			align-items: center;
			justify-content: center;
			margin-top: 30rpx;
		}
		.item{
			width: 100%;
			height: 80rpx;
			border-radius: 6rpx;
			border: 1rpx solid rgba(0,0,0,.1);
			display: flex;
			align-items: center;
			padding: 20rpx;
			margin-top: 30rpx;
			.txt{
				width: 100rpx;
			}
			.input{
				width: calc(100% - 160rpx );
				margin-right: 20rpx;
				height: 100%;
				input{
					width: 80%;
					height: 100%;
					font-size: 26rpx;
					margin-left: 10%;
				}
			}
			.info{
				color: rgba(0,0,0,.2);
			}
			.copy{
				width: 36rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				image{
					width: 100%;
				}
			}
		}
	}
</style>